﻿<!DOCTYPE html>
<html>
<head>
    <title>Member Detail</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link  href="<?php echo base_url();?>css/admin.css" rel="stylesheet" type="text/css" />
    <link  href="<?php echo base_url();?>css/userdetail.css" rel="stylesheet" type="text/css" />  
    
    
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		<script type="text/javascript" src="<?php echo base_url();?>js/highchart/js/highcharts.js"></script>

		<script type="text/javascript" src="<?php echo base_url();?>js/highchart/js/themes/gray.js"></script>
		<script type="text/javascript" src="<?php echo base_url();?>js/highchart/js/modules/exporting.js"></script>
</head>
<body>

 <div id="contentright">
        <div id="search">
          <div id="searchblank">
            <div id="searchinput">
             Welcome, admin
            </div>
          
            <div id="advancesearch"><a href="<?php echo site_url('login/logout');?>" class="advancesearch">Logout</a></div>
          </div>
        </div>
        </div>
    <div id="main">
      <?php 
        $menu['nowmenu'] = 'members';
        $this->load->view('common/divheader',$menu);
        ?>
        <div id="middle">
        <div id="breadcrumbs"><a href="dashboard.html">Dashboard</a>/ สมาชิก/ สมชาย</div>
            <?php $this->load->view('users/divleftmenu');?>
            <div id="center-column">
            <h1><?php echo $detail['vfirstname'].'  '.$detail['vlastname'];?></h1>
                <div class="top-bar">
                <ul id="top-selector">
                <li><a href="<?php echo site_url('users/form/'.$detail['uuid']);?>">Edit</a></li>
                
            </ul>
                    
            </div>
                <div class="select-bar">
                  
                    
                  
<div id="single_item_details">
<div id="leftcolumn"><h3><?php echo $detail['vendorcode'];?></h3><img src="<?php echo base_url();?>images/imageholder_detailspage.jpg" alt="Image" width="220" height="220" class="previewimg" />
</div>

<div id="rightcolumn">
<h2>ประเภท <?php echo $detail['vtype'];?></h2>
<p class="user"> กลุ่มสมาชิก <a href="#"><?php echo $detail['villagename'];?></a></p>
<p>ที่อยู่ <?php echo $detail['housenum'];?> 
		<?php if ($detail['villagename']) echo 'หมู่บ้าน '.$detail['villagename'].' ';?>
		<?php if ($detail['moono']) echo 'หมู่ '.$detail['moono'].' ';?>
		<?php if ($detail['street']) echo 'ถนน '.$detail['street'].' ';?>
		<?php if ($detail['district']) echo 'ตำบล '.$detail['district'].' ';?>
		<?php if ($detail['city']) echo 'อำเภอ '.$detail['city'].' ';?>
		<?php if ($detail['province']) echo 'จังหวัด '.$detail['province'].' ';?>
		<?php if ($detail['zipcode']) echo 'รหัสไปรษณีย์ '.$detail['zipcode'].' ';?>
<br />
  โทรศัพท์มือถือ : <?php echo $detail['vmobile'];?></p>
<p>โทรศัพท์บ้าน: <?php echo $detail['vphone'];?><br />
  วันเกิด : <?php echo $detail['vbirthdate'];?> 
  อายุ <?php 
  	function GetAge($Birthdate)
{
        // Explode the date into meaningful variables
        list($BirthYear,$BirthMonth,$BirthDay) = explode("-", $Birthdate);
        // Find the differences
        $YearDiff = date("Y") - $BirthYear;
        $MonthDiff = date("m") - $BirthMonth;
        $DayDiff = date("d") - $BirthDay;
        // If the birthday has not occured this year
        if ($DayDiff < 0 || $MonthDiff < 0)
          $YearDiff--;
        return $YearDiff;
}
	echo GetAge($detail['vbirthdate']);

  	
  ?> ปี</p>
<p>เพศ: <?php echo $detail['vgender'];?></p>
<p>สถานภาพสมรส: แต่งงาน</p>
<p>จำนวนบุตร: 5 คน (ชาย 3 คน หญิง 2 คน)</p>
<p>พืชที่ปลูก: มัน ยางพารา ข้าว</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p class="price">รวมยอดขายมัน: THB <?php echo $truckdetail['sum_netbuy'];?> ได้รับโบนัส: THB <?php echo $truckdetail['sum_promo'];?></p>
</div>

<div class="clear">&nbsp;</div>
</div>
              </div>
               
               <div class="top-bar">
                
                    <h1>ปริมาณการส่งวัตถุดิบ</h1>
                    
                    <script type="text/javascript">
                    var chart;
        			$(document).ready(function() {
        				chart = new Highcharts.Chart({
        					chart: {
        						renderTo: 'container',
        						type: 'line'
        					},
        					title: {
        						text: 'Supply sale statistics'
        					},
        					subtitle: {
        						
        						text: ''	
        					},
        					xAxis: {
        						type: 'datetime',
        						dateTimeLabelFormats: { // don't display the dummy year
        						second: '%H:%M:%S',
        						minute: '%H:%M',
        						hour: '%H:%M',
        						day: '%e. %b',
        						week: '%e. %b',
        						month: '%b \'%y',
        						year: '%Y'
        						}
        					},
        					yAxis: {
        						title: {
        							
        							text: ''
        						},
        						min: 0
        					},
        					tooltip: {
        						formatter: function() {
        				                return '<b>'+ this.series.name +'</b><br/>'+
        								Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +': '+ this.y+'        .';
        						}
        					},
        					series: [
        	{
						name: 'ราคาวัตถุดิบที่รับซื้อ',
						// Define the data points. All series have a dummy year
						// of 1970/71 in order to be compared on the same x axis. Note
						// that in JavaScript, months start at 0 for January, 1 for February etc.
						data: [
						<?php foreach ($salestatistic as $each):?>
						[<?=$each['carindatetime2'];?> , <?=$each['netbuy'];?> ],
						<?php endforeach;?>
						]
					},

					{
						name: 'น้ำหนักวัตถุดิบที่รับซื้อ',
						// Define the data points. All series have a dummy year
						// of 1970/71 in order to be compared on the same x axis. Note
						// that in JavaScript, months start at 0 for January, 1 for February etc.
						data: [
						<?php foreach ($salestatistic as $each):?>
						[<?=$each['carindatetime2'];?> , <?=$each['netwg'];?> ],
						<?php endforeach;?>
						]
					},

        					]
        				});
        				
        				
        			});
                    </script>
                     <p><div id="container" style="width: 700px; height: 400px; margin: 0 auto"></div></p>
                    
                    
                    
                    </div>
                    <div class="table">
                    <table class="listing" cellpadding="0" cellspacing="0">
                        <tr>
                            <th>วันที่รถเข้า</th>
                            <th>น้ำหนัก</th>
                            <th>ราคารับซื้อ</th>
                        </tr>
                        
                        <?php foreach ($salestatistic as $row):?>
                        	<tr>
                        		<td><?=$row['carindatetime']?></td>
                        		<td><?=$row['netwg']?></td>
                        		<td><?=$row['netbuy']?></td>
                        	</tr>
                        <?php endforeach;?>
                        
                    </table>
                    <div class="select">
                        <strong>Other Pages: </strong>
                        <select>
                            <option>1</option>
                      </select>
                  </div>
              </div>
                    <div class="top-bar">
                <a href="#" class="button">ADD </a>
                    <h1>พื้นที่เพาะปลูก</h1>
                    
              </div>
                <div class="table">
                    <table class="listing" cellpadding="0" cellspacing="0">
                        <tr>
                            <th>รหัสที่ดินเพาะปลูก</th>
                            <th>ประเภท</th>
                            <th>วันที่ลงทะเบียน</th>
                            <th>อัคราการผลิต</th>
                            <th>ปริมาณส่งวัตถุดิบ</th>
                            <th>กิจกรรมเพาะปลูก</th>
                            <th>คุณภาพที่ดิน</th>
                            <th>แก้ไข</th>
                        </tr>
                        <tr>
                            <td class="style1"><a href="member-detail.html">00123</a></td>
                            <td>Rent</td>
                            <td>2011-01-10</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td><img src="img/edit-icon.gif" width="16" height="16" alt="edit"></td>
                        </tr>
                        <tr>
                            <td class="style1"><a href="member-detail.html">00124</a></td>
                            <td>Own</td>
                            <td>2011-01-10</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td><img src="img/edit-icon.gif" width="16" height="16" alt="edit"></td>
                        </tr>
                        <tr>
                            <td class="style1"><a href="member-detail.html">00125</a></td>
                            <td>Own</td>
                            <td>2011-01-10</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td><img src="img/edit-icon.gif" width="16" height="16" alt="edit"></td>
                        </tr>
                    </table>
                    <div class="select">
                        <strong>Other Pages: </strong>
                        <select>
                            <option>1</option>
                      </select>
                  </div>
              </div> 
              
              </div>
          
              
              
         
            <div id="right-column">
              <strong class="h">บัตรประชาชน</strong>
                <div class="box">
                  <p><img src="img/UBE-logo.png" width="126" height="111" alt="photo"></p>
                  <p>3 1000 02400 71 71 1<img src="img/arrow.gif" width="8" height="5" alt="view"></p>
                </div>
                 <strong class="h">ทะเบียนบ้าน</strong>
              <div class="box">
                <p><img src="img/UBE-logo.png" width="126" height="111" alt="photo"></p>
                <p>222/22 หมู่บ้าน ก หมู่ 2</p>
                  <p>ตำบล อำเภอ</p>
                  <p>จังหวัด<img src="img/arrow.gif" width="8" height="5" alt="view"></p>
                </div>
              <strong class="h">โฉนดที่ดิน</strong>
                 <div class="box">
                   <p><img src="img/UBE-logo.png" width="126" height="111" alt="photo"></p>
                   <p>สปก 0000000000 <img src="img/arrow.gif" width="8" height="5" alt="view"></p>
                 </div>
            </div>
        </div>
        <div id="footer"><p>ALL RIGHTS RESERVED 2012 <a href="http://www.ubonbioethanol.com">UBON BIO ETHANOL CO., LTD.</a><br>Developed by DASH CO., LTD (2011-2012).  </p></div>
    </div>
</body>
</html>